// 策略
// 策略搜索
import request from '@/utils/request'
export const tacticsSearch = ({ pageIndex, pageSize, policyName }) => {
  return request({
    url: `/api/vm-service/policy/search`,
    params: {
      pageIndex, pageSize, policyName
    }
  })
}
// 新增策略
export const addTactics = (data) => {
  return request({
    url: `/api/vm-service/policy`,
    method: 'POST',
    data
  })
}
// 删除策略
export const delTactics = (policyId, pageIndex, pageSize, policyName) => {
  return request({
    url: `/api/vm-service/policy/${policyId}`,
    method: 'DELETE',
    data: {
      pageIndex, pageSize, policyName
    }
  })
}
// 修改策略
export const modifyAPi = (policyId, data) => {
  return request({
    url: `/api/vm-service/policy/${policyId}`,
    method: 'PUT',
    data
  })
}
// 根据策略搜索售货机
export const acAPi = (policyId, pageIndex, pageSize) => {
  return request({
    url: `/api/vm-service/policy/vmList/${policyId}`,
    params: {
      pageIndex, pageSize
    }
  })
}
